<?php
/**
 * CreateTime: 2023/11/15 10:17
 * User:LinQ
 */
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('jobs', function (Blueprint $table) {
            // 数据库基本配置
            $table->engine = 'InnoDB';
            // 数据库字段
            $table->id('jobs_id')->comment("任务id");
            $table->string('queue_name')->nullable(false)->comment("任务所属队列名称");
            $table->string('jobs_describe')->nullable(false)->comment("任务描述");
            $table->string('jobs_group_id')->nullable(false)->comment("分组id");
            $table->string('sum')->default(0)->nullable(false)->comment("任务总数");
            $table->string('flash')->default(0)->nullable(false)->comment("完成数量");
            $table->string('fail')->default(0)->nullable(false)->comment("失败数量");
            $table->string('jobs_status',50)->default(2)->nullable(false)->comment("任务是否完成 1是 2否 默认值为2");
            $table->string('status',50)->default(1)->nullable(false)->comment("是否删除 1是 2否 默认值为1");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
};
